<template>
  <view>
    <view class="loginBtn">
      <button class="btn" form-type="submit" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">手机号一键登录</button>
    </view>
  </view>
</template>
<script setup lang="ts">
import {loginFn} from "@/api";

const getPhoneNumber = (e: any) => {
  loginFn().then((res: any) => {
    console.log(res, '接口换取的openid')
    console.log('获取手机号的动态令牌:', e.detail.code) // 动态令牌
  })
}

</script>

<style scoped lang="scss">
.loginBtn {
  margin-top: 20px;
  width: 100%;
  .btn {
    width: 80%;
    border-radius: 20rpx;
    background-color: #ee3236;
    color: white;
  }
}
</style>
